﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace SaleOnlineSystem.Admin.Controls
{
    public partial class Chart : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                DataTable dt = DAL.DCollector.DBCollector.Instance.StoredProcedureSelectByColumns("TB_ThongKe", " * ", "selectbycolumns");

                chtCategoriesProductCountBarChart.DataSource = dt;
                chtCategoriesProductCountBarChart.DataBind();
                dt = DAL.DCollector.DBCollector.Instance.CallStored("callstored", "Select Orders_CreateDate , COUNT(Orders_CreateDate) as Orders_Count from tbl_Orders group by (Orders_CreateDate)", true);
                Chart_Order.DataSource = dt;
                Chart_Order.DataBind();
            }
            catch (Exception)
            {
                Response.Redirect("/error.htm");
            }           
        }
    }
}